//package com.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
//import org.springframework.security.crypto.password.PasswordEncoder;
//
//@Configuration
//public class SecurityConfig1 extends WebSecurityConfigurerAdapter {
//    @Override
//    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
//        //创建密码解析器
//        BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
//        //进行加密
//        String encode = passwordEncoder.encode("123");
//        //存入内存--加入用户名--加入密码--加入角色
//        auth.inMemoryAuthentication().withUser("lin").password(encode).roles("admin");
//    }
//    @Bean
//    PasswordEncoder password(){
//        return new BCryptPasswordEncoder();
//    }
//}
//
